com.rscja.deviceapi

## Class BleDevice

- java.lang.Object
- - com.rscja.deviceapi.UhfBase
  - - com.rscja.deviceapi.BleDevice

- All Implemented Interfaces:
    IBleDevice

      public class BleDevice
      extends UhfBase
      implements IBleDevice

  BLE蓝牙的操作对象
  1.通过`#connect(ConnectionStatusCallback
  ` 来连接蓝牙，bleStatusCallback是蓝牙状态的连接回调
  2.通过`setInventoryCallback(IUHFInventoryCallback inventoryCallback)` 标签数据回调接口。
  3.通过`startInventoryTag()` 开始盘点，在盘点过程中，ble设备只会响应`stopInventory()` ()}函数，不能设置和获取ble设备的相关其他参数。
  4.通过`stopInventory()` ()} 停止盘点

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BleDevice.BleDeviceInfo`

    - ### Nested classes/interfaces inherited from class com.rscja.deviceapi.UhfBase

      `UhfBase.ErrorCode`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BleDevice(java.lang.String mac, android.content.Context context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `blockWriteData(java.lang.String accessPwd, int filterBank, int filterPtr, int filterCnt, java.lang.String filterData, int bank, int ptr, int cnt, java.lang.String writeData)` 向标签写入数据(支持大数据标签写入)、当需要写入的标签数据比较大可以使用此函数写入 Write data into tag(support big-sized data writing), user could use this function when big-sized data need to be written.
    `void` | `connect()` 连接蓝牙(Connect Bluetooth)
    `void` | `connect(ConnectionStatusCallback<java.lang.Object> btStatusCallback)` 连接蓝牙(Connect Bluetooth)
    `boolean` | `deleteAllTagToFlash()` 删除R2、R6缓存的标签 Delete tag in buffer of R2 and R6
    `void` | `disconnect()` 断开蓝牙(Disconnect Bluetooth)
    `boolean` | `eraseData(java.lang.String accessPwd, int bank, int ptr, int cnt)` 擦除数据，被擦除的数据块其内容将被设置成0. Data block that has been cleaned will be setup to 0.
    `boolean` | `eraseData(java.lang.String accessPwd, int filterBank, int filterPtr, int filterCnt, java.lang.String filterData, int bank, int ptr, int cnt)` 擦除指定标签的数据，被擦除的数据块其内容将被设置成0. Clean specific tag data, data block after cleaned will be set to 0.
    `boolean` | `free()`
    `java.lang.String` | `generateLockCode(java.util.ArrayList<java.lang.Integer> lockBank, int lockMode)` 获取锁定码 Get lock code
    `int` | `getAllTagTotalFromFlash()` 获取R2、R6 缓存的标签数量 Acquire tag amounts in buffer of R2 and R6.
    `int` | `getBattery()` 获取电池电量 Acquire battery capacity
    `BleDevice.BleDeviceInfo` | `getBleDeviceInfo()`
    `java.lang.String` | `getBleHardwareVersion()` 获取蓝牙硬件版本
    `java.util.HashMap<java.lang.String,java.lang.String>` | `getBluetoothVersion()` 获取蓝牙版本号(acquire Bluetooth version)
    `ConnectionStatus` | `getConnectStatus()` 获取UHF连接状态 Acquire UHF connection status
    `int` | `getCW()` 获取连续波设置 Acquire CW setup
    `InventoryModeEntity` | `getEPCAndTIDUserMode()` 获取当前循环盘点的模式(EPC或者EPC+TID或者EPC+TID+USER) Acquire current scan mode(EPC or EPC+TID or EPC+TID+USER)
    `int` | `getFastID()`
    `int` | `getFrequencyMode()` 读取模块的工作模式 Read work mode of module
    `Gen2Entity` | `getGen2()`
    `java.lang.String` | `getMainboardVersion()` 获取主板吧版本
    `int` | `getNewTagTotalFromFlash()`
    `int` | `getPower()` 读取模块的功率 Read module output power
    `int` | `getProtocol()` 获取协议 Acquire protocol
    `int` | `getRFLink()` 获取链路参数 acquire link parameter
    `java.util.List<UHFTAGInfo>` | `getTagDataFromFlash()` 获取R2、R6缓存的标签信息 Acquire tag information in buffer of R2 and R6
    `int` | `getTagfocus()`
    `int` | `getTemperature()` 获取模块温度 Acquire module Temperature
    `java.lang.String` | `getUhfSoftwareVersion()` 读取UHF模块版本号 Read UHF module version
    `boolean` | `init(android.content.Context context)`
    `UHFTAGInfo` | `inventorySingleTag()` 单步识别标签 Identify tag in single mode
    `boolean` | `isInventorying()` uhf 是否正在盘点
    `boolean` | `isSupportRssi()`
    `boolean` | `killTag(java.lang.String killPwd)` 销毁指定标签,默认密码(0x00 0x00 0x00 0x00)不能执行销毁 Kill specific tag, default password(0x00 0x00 0x00 0x00)
    `boolean` | `killTag(java.lang.String accessPwd, int filterBank, int filterPtr, int filterCnt, java.lang.String filterData)` 销毁指定标签 ,默认密码(0x00 0x00 0x00 0x00)不能执行销毁 Kill specific tag, default password(0x00 0x00 0x00 0x00)
    `boolean` | `lockMem(java.lang.String accessPwd, int bank, int ptr, int cnt, java.lang.String filterData, java.lang.String lockCode)` 锁定指定标签 Lock specific tag
    `boolean` | `lockMem(java.lang.String accessPwd, java.lang.String lockCode)` 锁定标签 Lock tag
    `java.lang.String` | `readData(java.lang.String accessPwd, int bank, int ptr, int cnt)` 读取标签数据 Read tag data
    `java.lang.String` | `readData(java.lang.String accessPwd, int filterBank, int filterPtr, int filterCnt, java.lang.String filterData, int bank, int ptr, int cnt)` 读取指定标签数据 Read specific tag data
    `java.lang.String` | `scanBarcode()` 扫描条码 Scan barcode
    `byte[]` | `scanBarcodeToBytes()` 扫描条码 Scan barcode
    `boolean` | `setBeep(boolean isOpen)` 设置蜂鸣器开关 Setup buzzer ON/OFF
    `void` | `setConnectionStatusCallback(ConnectionStatusCallback<java.lang.Object> btStatusCallback)` 设置UHF连接状态回调 Setup UHF continuous stauts call-back
    `boolean` | `setCW(int flag)` 设置连续波 Setup CW
    `boolean` | `setEPCAndTIDMode()` 设置循环盘点同时读取 EPC、TID 模式 Setup auto scan to acquire EPC, TID mode
    `boolean` | `setEPCAndTIDUserMode(int user_prt, int user_len)` 设置循环盘点同时读取 EPC、TID、USER 模式 Setup auto scan to acquire EPC, TID, User mode
    `boolean` | `setEPCMode()` 设置循环盘点只获取EPC的数据 Setup auto scan to acquire EPC only
    `boolean` | `setFastID(boolean enalbe)` 开关FastID功能 ON/OFF FastID function
    `boolean` | `setFilter(int bank, int ptr, int cnt, java.lang.String data)` 过滤循环盘点的标签，在`startInventoryTag()`循环盘点标签之前，可以设置要过滤的数据。 Filter tag in auto scan mode, before scanning tags `startInventoryTag()`, setup data that needs to be filtered.
    `boolean` | `setFreHop(float fre)` 设置模块频点 Setup frequency Hop
    `boolean` | `setFrequencyMode(int freMode)` 设置模块的工作模式 Setup work mode of module
    `boolean` | `setGen2(Gen2Entity gen2Entity)` 设置 Gen2参数 Setup Gen2 parameter
    `void` | `setInventoryCallback(IUHFInventoryCallback inventoryCallback)` 设置盘点回调接口，接收循环盘点到的标签数据 Set the inventory callback interface to receive the label data from the cyclic inventory 备注：需要在开始循环盘点`startInventoryTag()`之前调用此方法。 Note: This method needs to be called before starting the loop inventory `startInventoryTag()`.
    `void` | `setKeyEventCallback(KeyEventCallback KeyEventCallback)` 设置扫描按键回调 Setup SCAN button call back
    `boolean` | `setPower(int power)` 设置模块的功率 Setup output power
    `boolean` | `setProtocol(int protocol)` 设置协议 Setup protocol
    `boolean` | `setRemoteBluetoothName(java.lang.String name)` 修改蓝牙名称(Change Bluetooth device Name)
    `boolean` | `setRFLink(int mode)` 设置链路参数 Setup RFlink
    `void` | `setSupportRssi(boolean isSupportRssi)`
    `boolean` | `setTagFocus(boolean enalbe)` 开关TagFocus功能 ON/OFF TagFocus
    `boolean` | `startInventoryTag()` 启动识别Tag循环 Enable Tag auto reading
    `boolean` | `startLocation(java.lang.String label, int bank, int ptr, IUHFLocationCallback locationCallback)` 开始定位
    `boolean` | `stopInventory()` 停止循环识别 Stop auto reading
    `boolean` | `stopLocation()` 停止定位
    `boolean` | `uhfBlockPermalock(java.lang.String accessPwd, int filterBank, int filterPtr, int filterCnt, java.lang.String filterData, int ReadLock, int uBank, int uPtr, int uRange, byte[] uMaskbuf)` 数据块操作
    `boolean` | `uhfJump2Boot()` uhf进入boot模式 ，开始升级之前需要调用此函数 UHF enter boot mode, need to call this formula before upgrade
    `boolean` | `uhfJump2Boot(int type)`
    `boolean` | `uhfJumpToMainboardBoot()` 升级STM32主板需要调用此函数进入boot模式 Upgrade STM32 mainboard that need to call this function to enter boot mode.
    `boolean` | `uhfStartUpdate()` 开始升级uhf模块 Start upgrade UHF module
    `boolean` | `uhfStopUpdate()` 停止升级uhf模块，uhf模块升级完成后需要调用此函数 Stop upgrade UHF module, call this formula after module has been upgraded.
    `boolean` | `uhfUpdating(byte[] buff)` 升级uhf模块，发送uhf固件数据 Upgrade UHF module, send UHF firmware data
    `boolean` | `writeData(java.lang.String accessPwd, int bank, int ptr, int cnt, java.lang.String data)` 向标签写入数据 Write data in tag
    `boolean` | `writeData(java.lang.String accessPwd, int filterBank, int filterPtr, int filterCnt, java.lang.String filterData, int bank, int ptr, int cnt, java.lang.String writeData)` 将数据写入指定标签 Write data
    `boolean` | `writeDataToEpc(java.lang.String accessPwd, int filterBank, int filterPtr, int filterCnt, java.lang.String filterData, java.lang.String writeData)` 将数据写入到EPC,而且自动适配盘点的EPC长度 Write data to epc
    `boolean` | `writeDataToEpc(java.lang.String accessPwd, java.lang.String writeData)` 将数据写入到EPC,而且自动适配盘点的EPC长度 Write data to epc

    - ### Methods inherited from class com.rscja.deviceapi.UhfBase

      `factoryReset, getFastInventoryMode, readTcpServiceState, setEPCAndTIDUserMode, setFastInventoryMode, setOnLowBatteryListener`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BleDevice

          public BleDevice(java.lang.String mac,
                           android.content.Context context)

  - ### Method Detail

    - #### getBleDeviceInfo

          public BleDevice.BleDeviceInfo getBleDeviceInfo()

      Specified by:
        `getBleDeviceInfo` in interface `IBleDevice`

    - #### getFastID

          public int getFastID()

      Specified by:
        `getFastID` in interface `IBleDevice`

    - #### getTagfocus

          public int getTagfocus()

      Specified by:
        `getTagfocus` in interface `IBleDevice`

    - #### isSupportRssi

          public boolean isSupportRssi()

      Specified by:
        `isSupportRssi` in interface `IBleDevice`

    - #### connect

          public void connect()

      连接蓝牙(Connect Bluetooth)
      Specified by:
        `connect` in interface `IBleDevice`

    - #### connect

          public void connect(ConnectionStatusCallback<java.lang.Object> btStatusCallback)

      连接蓝牙(Connect Bluetooth)
      Specified by:
        `connect` in interface `IBleDevice`
      Parameters:
        `btStatusCallback` - 蓝牙连接状态回调接口(Bluetooth connection status call back)

    - #### disconnect

          public void disconnect()

      断开蓝牙(Disconnect Bluetooth)
      Specified by:
        `disconnect` in interface `IBleDevice`

    - #### setSupportRssi

          public void setSupportRssi(boolean isSupportRssi)

      Specified by:
        `setSupportRssi` in interface `IBleDevice`

    - #### uhfJumpToMainboardBoot

          public boolean uhfJumpToMainboardBoot()

      升级STM32主板需要调用此函数进入boot模式
      Upgrade STM32 mainboard that need to call this function to enter boot mode.
      Specified by:
        `uhfJumpToMainboardBoot` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### setRemoteBluetoothName

          public boolean setRemoteBluetoothName(java.lang.String name)

      修改蓝牙名称(Change Bluetooth device Name)
      Specified by:
        `setRemoteBluetoothName` in interface `IBleDevice`
      Parameters:
        `name` - 新的蓝牙名称(New Bluetooth name)
      Returns:
        true:成功(success) false:失败(failure)

    - #### getBluetoothVersion

          public java.util.HashMap<java.lang.String,java.lang.String> getBluetoothVersion()

      获取蓝牙版本号(acquire Bluetooth version)
      Specified by:
        `getBluetoothVersion` in interface `IBleDevice`
      Returns:
        key:`IBluetoothReader.VERSION_BT_FIRMWARE` 表示固件版本(Firmware Version), key:`IBluetoothReader.VERSION_BT_HARDWARE` 表示硬件版本(Hardware version) ， key:`IBluetoothReader.VERSION_BT_SOFTWARE` 表示软件版本(software version)

    - #### getBleHardwareVersion

          public java.lang.String getBleHardwareVersion()

      获取蓝牙硬件版本
      Specified by:
        `getBleHardwareVersion` in interface `IBleDevice`
      Returns:

    - #### stopLocation

          public boolean stopLocation()

      停止定位
      Specified by:
        `stopLocation` in interface `IBleDevice`
      Returns:

    - #### startLocation

          public boolean startLocation(java.lang.String label,
                                       int bank,
                                       int ptr,
                                       IUHFLocationCallback locationCallback)

      开始定位
      Specified by:
        `startLocation` in interface `IBleDevice`
      Parameters:
        `label` - 指定标签数据
        `bank` - 存储区
        `ptr` - 起始地址，单位:字
        `locationCallback` - 定位回调
      Returns:

    - #### getMainboardVersion

          public java.lang.String getMainboardVersion()

      获取主板吧版本
      Specified by:
        `getMainboardVersion` in interface `IBleDevice`
      Returns:

    - #### getBattery

          public int getBattery()

      获取电池电量
      Acquire battery capacity
      Specified by:
        `getBattery` in interface `IBleDevice`
      Returns:
        返回电量，-1表示获取电量失败(return battery capacity, -1 means acquire failure.)

    - #### setBeep

          public boolean setBeep(boolean isOpen)

      设置蜂鸣器开关
      Setup buzzer ON/OFF
      Specified by:
        `setBeep` in interface `IBleDevice`
      Parameters:
        `isOpen` - true:打开蜂鸣器(ON)， false:关闭蜂鸣器(OFF)
      Returns:
        true:成功(success) false:失败(failure)

    - #### scanBarcode

          public java.lang.String scanBarcode()

      扫描条码
      Scan barcode
      Specified by:
        `scanBarcode` in interface `IBleDevice`
      Returns:
        返回条码字符串数据(return barcode string data)

    - #### scanBarcodeToBytes

          public byte[] scanBarcodeToBytes()

      扫描条码
      Scan barcode
      Specified by:
        `scanBarcodeToBytes` in interface `IBleDevice`
      Returns:
        返回条码的原始byte数据(return initial byte data of barcode)

    - #### setKeyEventCallback

          public void setKeyEventCallback(KeyEventCallback KeyEventCallback)

      设置扫描按键回调
      Setup SCAN button call back
      Specified by:
        `setKeyEventCallback` in interface `IBleDevice`
      Parameters:
        `KeyEventCallback` - 按键回调接口(Keyboard call back)

    - #### getPower

          public int getPower()

      读取模块的功率
      Read module output power
      Specified by:
        `getPower` in interface `IBleDevice`
      Returns:
        返回功率，返回-1为失败(Return output power, return -1 means failure.)

    - #### setPower

          public boolean setPower(int power)

      设置模块的功率
      Setup output power
      Specified by:
        `setPower` in interface `IBleDevice`
      Parameters:
        `power` - 功率值(Power values)
      Returns:
        true:成功(success) false:失败(failure)

    - #### getUhfSoftwareVersion

          public java.lang.String getUhfSoftwareVersion()

      读取UHF模块版本号
      Read UHF module version
      Specified by:
        `getUhfSoftwareVersion` in interface `IBleDevice`
      Returns:
        返回模块类型，null为读取失败(Resture module type, null means read failure.)

    - #### getFrequencyMode

          public int getFrequencyMode()

      读取模块的工作模式
      Read work mode of module
      Specified by:
        `getFrequencyMode` in interface `IBleDevice`
      Returns:
        返回工作模式，返回-1为失败 (return work mode, return -1 means failure)
        0x01：China Standard(840~845MHz)
        0x02：China Standard2(920~925MHz)
        0x04：Europe Standard(865~868MHz)
        0x08：USA(902-928MHz)
        0x16：Korea(917~923MHz)
        0x32: Japan(916.8~920.8MHz)
        0x33: South Africa(915~919MHz)
        0x34: China Taiwan(920~928Mhz)
        0x35:Vietnam(918~923MHz)
        0x36:Peru(915MHz-928MHz)
        0x37:Russia( 860MHz-867.6MHz)
        0x3B:Malaysia(919-923MHz)
        0x3C:Brazil
        0x3D:ETSI_UPPER
        0x3E:Australia
        0x3F:Indonesia(920-923MHz)
        0x40:Israel
        0x41:HK
        0x42:New Zealand

    - #### setFrequencyMode

          public boolean setFrequencyMode(int freMode)

      设置模块的工作模式
      Setup work mode of module
      Specified by:
        `setFrequencyMode` in interface `IBleDevice`
      Parameters:
        `freMode` - 0x01：China Standard(840~845MHz)
        0x02：China Standard2(920~925MHz)
        0x04：Europe Standard(865~868MHz)
        0x08：USA(902-928MHz)
        0x16：Korea(917~923MHz)
        0x32: Japan(916.8~920.8MHz)
        0x33: South Africa(915~919MHz)
        0x34: China Taiwan(920~928Mhz)
        0x35:Vietnam(918~923MHz)
        0x36:Peru(915MHz-928MHz)
        0x37:Russia( 860MHz-867.6MHz)
        0x3B:Malaysia(919-923MHz)
        0x3C:Brazil
        0x3D:ETSI_UPPER
        0x3E:Australia
        0x3F:Indonesia(920-923MHz)
        0x40:Israel
        0x41:HK
        0x42:New Zealand
      Returns:
        true:成功(success) false:失败(failure)

    - #### startInventoryTag

          public boolean startInventoryTag()

      启动识别Tag循环
      Enable Tag auto reading
      Specified by:
        `startInventoryTag` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### stopInventory

          public boolean stopInventory()

      停止循环识别
      Stop auto reading
      Specified by:
        `stopInventory` in interface `IBleDevice`
      Specified by:
        `stopInventory` in class `UhfBase`
      Returns:
        true:成功(success) false:失败(failure)

    - #### generateLockCode

          public java.lang.String generateLockCode(java.util.ArrayList<java.lang.Integer> lockBank,
                                                   int lockMode)

      获取锁定码
      Get lock code
      Specified by:
        `generateLockCode` in interface `IBleDevice`
      Parameters:
        `lockBank` - 要锁定的区域 (lockBank areas that need to lock ):
        `com.rscja.deviceapi.interfaces.IUHF.LockBank_KILL`
        `com.rscja.deviceapi.interfaces.IUHF.LockBank_ACCESS`
        `com.rscja.deviceapi.interfaces.IUHF.LockBank_TID`
        `com.rscja.deviceapi.interfaces.IUHF.LockBank_USER`
        `com.rscja.deviceapi.interfaces.IUHF.LockBank_EPC`
        `lockMode` - 锁定的模式(lockMode lock modes):
        `com.rscja.deviceapi.interfaces.IUHF.LockMode_LOCK`
        `com.rscja.deviceapi.interfaces.IUHF.LockMode_OPEN`
        `com.rscja.deviceapi.interfaces.IUHF.LockMode_PLOCK`
        `com.rscja.deviceapi.interfaces.IUHF.LockMode_POPEN`
      Returns:
        返回锁定码，null表示失败(return lock code, null means failure)

    - #### lockMem

          public boolean lockMem(java.lang.String accessPwd,
                                 int bank,
                                 int ptr,
                                 int cnt,
                                 java.lang.String filterData,
                                 java.lang.String lockCode)

      锁定指定标签
      Lock specific tag
      Specified by:
        `lockMem` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `bank` - 标签的存储区(memory area):
        `#IUHF.Bank_RESERVED`、`#IUHF.Bank_EPC`、`#IUHF.Bank_TID`、`#IUHF.Bank_USER`
        `ptr` - 过滤起始地址,单位:bit (Filter start address,unit:bit)
        `cnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤。 (Filter data length(unit:bit) when filter length is 0, it means no filter.)
        `filterData` - 过滤数据(Filter data)
        `lockCode` - 锁定码 (Lock Code)
      Returns:
        true:成功(success) false:失败(failure)

    - #### lockMem

          public boolean lockMem(java.lang.String accessPwd,
                                 java.lang.String lockCode)

      锁定标签
      Lock tag
      Specified by:
        `lockMem` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `lockCode` - 锁定码 (Lock Code)
      Returns:
        true:成功(success) false:失败(failure)

    - #### inventorySingleTag

          public UHFTAGInfo inventorySingleTag()

      单步识别标签
      Identify tag in single mode
      Specified by:
        `inventorySingleTag` in interface `IBleDevice`
      Returns:
        返回标签信息(return tag infor)

    - #### readData

          public java.lang.String readData(java.lang.String accessPwd,
                                           int bank,
                                           int ptr,
                                           int cnt)

      读取标签数据
      Read tag data
      Specified by:
        `readData` in interface `IBleDevice`
      Parameters:
        `accessPwd` - Access password
        `bank` - 读取的存储区(read storage area): `#IUHF.Bank_RESERVED`、`#IUHF.Bank_EPC`、`#IUHF.Bank_TID`、`#IUHF.Bank_USER`
        `ptr` - 读取的起始地址(单位:字) (read start address(unit: word))
        `cnt` - 读取的数据长度(单位:字) (read data length(unit: word))
      Returns:
        返回获取的数据, null表示读取失败 (return acquired data, null means read failure)

    - #### readData

          public java.lang.String readData(java.lang.String accessPwd,
                                           int filterBank,
                                           int filterPtr,
                                           int filterCnt,
                                           java.lang.String filterData,
                                           int bank,
                                           int ptr,
                                           int cnt)

      读取指定标签数据
      Read specific tag data
      Specified by:
        `readData` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `filterBank` - 过滤的存储区(Filtered storage area ): `#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `filterPtr` - 过滤的起始地址(Filter start address)
        `filterCnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `filterData` - 过滤的数据(Filtered data)
        `bank` - 读取的存储区(Read storage area) `#Bank_RESERVED`、`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `ptr` - 读取的起始地址(单位:字) (read start address(unit: word))
        `cnt` - 读取的数据长度(单位:字) (read data length(unit: word))
      Returns:
        返回获取的数据, null表示读取失败 (return acquired data, null means read failure)

    - #### writeData

          public boolean writeData(java.lang.String accessPwd,
                                   int bank,
                                   int ptr,
                                   int cnt,
                                   java.lang.String data)

      向标签写入数据
      Write data in tag
      Specified by:
        `writeData` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `bank` - 标签的存储区(Storage area):`#Bank_RESERVED`、`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `ptr` - 起始地址的偏移量(start address(unit: word))
        `cnt` - 数据的长度（Word为单位，不能为0）(Data length(Word is unit, cannot be 0))
        `data` - 要写入的数据,十六进制格式 (Data format should be hexvalue)
      Returns:
        true:成功(success) false:失败(failure)

    - #### writeData

          public boolean writeData(java.lang.String accessPwd,
                                   int filterBank,
                                   int filterPtr,
                                   int filterCnt,
                                   java.lang.String filterData,
                                   int bank,
                                   int ptr,
                                   int cnt,
                                   java.lang.String writeData)

      将数据写入指定标签
      Write data
      Specified by:
        `writeData` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `filterBank` - 过滤的存储区(Filtered storage area ): `#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `filterPtr` - 过滤的起始地址(Filter start address)
        `filterCnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `filterData` - 过滤的数据(Filtered data)
        `bank` - 标签的存储区(Storage area): `#Bank_RESERVED`、`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `ptr` - 起始地址的偏移量(start address(unit: word))
        `cnt` - 数据的长度（Word为单位，不能为0）(Data length(Word is unit, cannot be 0))
        `writeData` - 要写入的数据,十六进制格式 (Data format should be hexvalue)
      Returns:
        true:成功(success) false:失败(failure)

    - #### writeDataToEpc

          public boolean writeDataToEpc(java.lang.String accessPwd,
                                        int filterBank,
                                        int filterPtr,
                                        int filterCnt,
                                        java.lang.String filterData,
                                        java.lang.String writeData)

      将数据写入到EPC,而且自动适配盘点的EPC长度
      Write data to epc
      Specified by:
        `writeDataToEpc` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `filterBank` - 过滤的存储区(Filtered storage area ): `#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `filterPtr` - 过滤的起始地址(Filter start address)
        `filterCnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `filterData` - 过滤的数据(Filtered data)
        `writeData` - 要写入的数据,十六进制格式 (Data format should be hexvalue)
      Returns:
        true:成功(success) false:失败(failure)

    - #### writeDataToEpc

          public boolean writeDataToEpc(java.lang.String accessPwd,
                                        java.lang.String writeData)

      将数据写入到EPC,而且自动适配盘点的EPC长度
      Write data to epc
      Specified by:
        `writeDataToEpc` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `writeData` - 要写入的数据,十六进制格式 (Data format should be hexvalue)
      Returns:
        true:成功(success) false:失败(failure)

    - #### blockWriteData

          public boolean blockWriteData(java.lang.String accessPwd,
                                        int filterBank,
                                        int filterPtr,
                                        int filterCnt,
                                        java.lang.String filterData,
                                        int bank,
                                        int ptr,
                                        int cnt,
                                        java.lang.String writeData)

      向标签写入数据(支持大数据标签写入)、当需要写入的标签数据比较大可以使用此函数写入
      Write data into tag(support big-sized data writing), user could use this function when big-sized data need to be written.
      Specified by:
        `blockWriteData` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `filterBank` - 过滤的存储区(Filtered storage area ): `#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `filterPtr` - 过滤的起始地址(Filter start address)
        `filterCnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `filterData` - 过滤的数据(Filtered data)
        `bank` - 标签的存储区(Storage area): `#Bank_RESERVED`、`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `ptr` - 起始地址的偏移量(start address(unit: word))
        `cnt` - 数据的长度（Word为单位，不能为0）(Data length(Word is unit, cannot be 0))
        `writeData` - 要写入的数据,十六进制格式 (Data format should be hexvalue)
      Returns:
        true:成功(success) false:失败(failure)

    - #### eraseData

          public boolean eraseData(java.lang.String accessPwd,
                                   int filterBank,
                                   int filterPtr,
                                   int filterCnt,
                                   java.lang.String filterData,
                                   int bank,
                                   int ptr,
                                   int cnt)

      擦除指定标签的数据，被擦除的数据块其内容将被设置成0.
      Clean specific tag data, data block after cleaned will be set to 0.
      Specified by:
        `eraseData` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `filterBank` - 过滤的存储区(Filtered storage area ):`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `filterPtr` - 过滤的起始地址(Filter start address)
        `filterCnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `filterData` - 过滤的数据(Filtered data)
        `bank` - 擦除的数据区域(Cleaned data block):`#Bank_RESERVED`、 `#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `ptr` - 擦除的起始地址(单位:字) (Cleaned start address(Unit: word))
        `cnt` - 擦除的数据长度(单位:字) (Cleaned data length(Unit: word))
      Returns:
        true:成功(success) false:失败(failure)

    - #### eraseData

          public boolean eraseData(java.lang.String accessPwd,
                                   int bank,
                                   int ptr,
                                   int cnt)

      擦除数据，被擦除的数据块其内容将被设置成0.
      Data block that has been cleaned will be setup to 0.
      Specified by:
        `eraseData` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `bank` - 擦除的数据区域(Cleaned data block):`#Bank_RESERVED`、 `#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `ptr` - 擦除的起始地址(单位:字) (Cleaned start address(Unit: word))
        `cnt` - 擦除的数据长度(单位:字) (Cleaned data length(Unit: word))
      Returns:
        true:成功(success) false:失败(failure)

    - #### setFilter

          public boolean setFilter(int bank,
                                   int ptr,
                                   int cnt,
                                   java.lang.String data)

      过滤循环盘点的标签，在`startInventoryTag()`循环盘点标签之前，可以设置要过滤的数据。
      Filter tag in auto scan mode, before scanning tags `startInventoryTag()`, setup data that needs to be filtered.
      Specified by:
        `setFilter` in interface `IBleDevice`
      Parameters:
        `bank` - 过滤的存储区(Filtered storage area ): `#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `ptr` - 过滤的起始地址(Filter start address)
        `cnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `data` - 过滤的数据(Filtered data)
      Returns:
        true:成功(success) false:失败(failure)

    - #### killTag

          public boolean killTag(java.lang.String killPwd)

      销毁指定标签,默认密码(0x00 0x00 0x00 0x00)不能执行销毁
      Kill specific tag, default password(0x00 0x00 0x00 0x00)
      Specified by:
        `killTag` in interface `IBleDevice`
      Parameters:
        `killPwd` - 销毁密码(Kill password)
      Returns:
        true:成功(success) false:失败(failure)

    - #### killTag

          public boolean killTag(java.lang.String accessPwd,
                                 int filterBank,
                                 int filterPtr,
                                 int filterCnt,
                                 java.lang.String filterData)

      销毁指定标签 ,默认密码(0x00 0x00 0x00 0x00)不能执行销毁
      Kill specific tag, default password(0x00 0x00 0x00 0x00)
      Specified by:
        `killTag` in interface `IBleDevice`
      Parameters:
        `accessPwd` - 销毁密码(Kill password)
        `filterBank` - 过滤的存储区(Filtered storage area ):`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `filterPtr` - 过滤的起始地址(Filter start address)
        `filterCnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `filterData` - 过滤的数据(Filtered data)
      Returns:
        true:成功(success) false:失败(failure)

    - #### setProtocol

          public boolean setProtocol(int protocol)

      设置协议
      Setup protocol
      Specified by:
        `setProtocol` in interface `IBleDevice`
      Parameters:
        `protocol` - 0x00： ISO18000-6C
        0x01 ：GB/T 29768
        0x02 ： GJB 7377.1
        0x03 ： ISO 18000-6B
      Returns:
        true:成功(success) false:失败(failure)

    - #### getProtocol

          public int getProtocol()

      获取协议
      Acquire protocol
      Specified by:
        `getProtocol` in interface `IBleDevice`
      Returns:
        0x00 ：ISO18000-6C
        0x01 ： GB/T 29768
        0x02 ： GJB 7377.1

    - #### setFreHop

          public boolean setFreHop(float fre)

      设置模块频点
      Setup frequency Hop
      Specified by:
        `setFreHop` in interface `IBleDevice`
      Parameters:
        `fre` - 要设置的频点(frequency need to be set)
      Returns:
        true:成功(success) false:失败(failure)

    - #### setRFLink

          public boolean setRFLink(int mode)

      设置链路参数
      Setup RFlink
      Specified by:
        `setRFLink` in interface `IBleDevice`
      Parameters:
        `mode` - 0-PR ASK/Miller8/160KHz
        1-PR ASK /Miller4/250KHz
        2-PR ASK/Miller4/ 320KHz
        3-PR ASK/Miller4/640KHz
        4-PR ASK/Miller2/320KHz
        5-PR ASK/Miller2/640KHz
        A-Gen2X/Miller8/ 160KHz
        B-Gen2X/Miller4/ 250KHz
        C-Gen2X/Miller4/320KHz
        D-Gen2x/Miller4/ 640KHz
        E-Gen2X/Miller2/320KHz
        F-Gen2X/Miller2/ 640KHz
      Returns:
        true:成功(success) false:失败(failure)

    - #### getRFLink

          public int getRFLink()

      获取链路参数
      acquire link parameter
      Specified by:
        `getRFLink` in interface `IBleDevice`
      Returns:
        0: DSB_ASK/FM0/40KH;
        1:PR_ASK/Miller4/250KHz;
        2:PR_ASK/Miller4/300KHz;
        3:DSB_ASK/FM0/400KHz

    - #### setFastID

          public boolean setFastID(boolean enalbe)

      开关FastID功能
      ON/OFF FastID function
      Specified by:
        `setFastID` in interface `IBleDevice`
      Parameters:
        `enalbe` - true：开(on)，false：关(off)
      Returns:
        true:成功(success) false:失败(failure)

    - #### setTagFocus

          public boolean setTagFocus(boolean enalbe)

      开关TagFocus功能
      ON/OFF TagFocus
      Specified by:
        `setTagFocus` in interface `IBleDevice`
      Parameters:
        `enalbe` - true：开(on)，false：关(off)
      Returns:
        true:成功(success) false:失败(failure)

    - #### setEPCMode

          public boolean setEPCMode()

      设置循环盘点只获取EPC的数据
      Setup auto scan to acquire EPC only
      Specified by:
        `setEPCMode` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### setEPCAndTIDMode

          public boolean setEPCAndTIDMode()

      设置循环盘点同时读取 EPC、TID 模式
      Setup auto scan to acquire EPC, TID mode
      Specified by:
        `setEPCAndTIDMode` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### setEPCAndTIDUserMode

          public boolean setEPCAndTIDUserMode(int user_prt,
                                              int user_len)

      设置循环盘点同时读取 EPC、TID、USER 模式
      Setup auto scan to acquire EPC, TID, User mode
      Specified by:
        `setEPCAndTIDUserMode` in interface `IBleDevice`
      Parameters:
        `user_prt` - USER区起始地址(Start addressin USER area)
        `user_len` - USER区长度(Data length in USER area)
      Returns:
        true:成功(success) false:失败(failure)

    - #### getEPCAndTIDUserMode

          public InventoryModeEntity getEPCAndTIDUserMode()

      获取当前循环盘点的模式(EPC或者EPC+TID或者EPC+TID+USER)
      Acquire current scan mode(EPC or EPC+TID or EPC+TID+USER)
      Specified by:
        `getEPCAndTIDUserMode` in interface `IBleDevice`

    - #### getTemperature

          public int getTemperature()

      获取模块温度
      Acquire module Temperature
      Specified by:
        `getTemperature` in interface `IBleDevice`
      Returns:
        模块温度(Temperature)

    - #### uhfBlockPermalock

          public boolean uhfBlockPermalock(java.lang.String accessPwd,
                                           int filterBank,
                                           int filterPtr,
                                           int filterCnt,
                                           java.lang.String filterData,
                                           int ReadLock,
                                           int uBank,
                                           int uPtr,
                                           int uRange,
                                           byte[] uMaskbuf)

      数据块操作
      Specified by:
        `uhfBlockPermalock` in interface `IBleDevice`
      Parameters:
        `accessPwd` - ACCESS PASSWORD (4 bites)
        `filterBank` - 过滤的存储区(Filtered storage area ):`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `filterPtr` - 过滤的起始地址(Filter start address)
        `filterCnt` - 过滤数据长度(单位:bit),当过滤的数据长度为0时，表示无过滤 ( Filter data length(unit:bit), when filter data length is 0, it means no filter.)
        `filterData` - 过滤的数据(Filtered data)
        `ReadLock:` - 0表示读设置 1表示锁设置 (0 menas read config 1 means lock config)
        `uBank:` - 存储区域(Storage area): `#Bank_RESERVED`、`#Bank_EPC`、`#Bank_TID`、`#Bank_USER`
        `uPtr:` - 存储区域起始地址 ，默认为0，其中 1个块单元为16个块 (Start address in storage area, default is 0, 1 unit has 16 blocks)
        `uRange:` - 存储区域结束范围，默认为1，其中 1个块单元为16个块 (End of storage, default is 1, 1 unit has 16 blocks)
        `uMaskbuf:` - 设置锁MSAK， 高位在前，每个bit 代表为1个块，默认为2字节 (Setup lock MSAK, high level is at front, every bit has 1 block, default is 2 bytes.)
      Returns:
        true:成功(success) false:失败(failure)

    - #### setGen2

          public boolean setGen2(Gen2Entity gen2Entity)

      设置 Gen2参数
      Setup Gen2 parameter
      Specified by:
        `setGen2` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### getGen2

          public Gen2Entity getGen2()

      Specified by:
        `getGen2` in interface `IBleDevice`

    - #### setCW

          public boolean setCW(int flag)

      设置连续波
      Setup CW
      Specified by:
        `setCW` in interface `IBleDevice`
      Parameters:
        `flag` - 1:表示开， 0：表示关
      Returns:
        true:成功(success) false:失败(failure)

    - #### getCW

          public int getCW()

      获取连续波设置
      Acquire CW setup
      Specified by:
        `getCW` in interface `IBleDevice`
      Returns:
        reutrn 1:表示开， 0：表示关

    - #### uhfJump2Boot

          public boolean uhfJump2Boot()

      uhf进入boot模式 ，开始升级之前需要调用此函数
      UHF enter boot mode, need to call this formula before upgrade
      Specified by:
        `uhfJump2Boot` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### uhfJump2Boot

          public boolean uhfJump2Boot(int type)

      Specified by:
        `uhfJump2Boot` in interface `IBleDevice`

    - #### uhfStartUpdate

          public boolean uhfStartUpdate()

      开始升级uhf模块
      Start upgrade UHF module
      Specified by:
        `uhfStartUpdate` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### uhfUpdating

          public boolean uhfUpdating(byte[] buff)

      升级uhf模块，发送uhf固件数据
      Upgrade UHF module, send UHF firmware data
      Specified by:
        `uhfUpdating` in interface `IBleDevice`
      Parameters:
        `buff` - 固件数据(buff firmware data)
      Returns:
        true:成功(success) false:失败(failure)

    - #### uhfStopUpdate

          public boolean uhfStopUpdate()

      停止升级uhf模块，uhf模块升级完成后需要调用此函数
      Stop upgrade UHF module, call this formula after module has been upgraded.
      Specified by:
        `uhfStopUpdate` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### setConnectionStatusCallback

          public void setConnectionStatusCallback(ConnectionStatusCallback<java.lang.Object> btStatusCallback)

      设置UHF连接状态回调
      Setup UHF continuous stauts call-back
      Specified by:
        `setConnectionStatusCallback` in interface `IBleDevice`
      Parameters:
        `btStatusCallback` - 回调接口(Callback interface)

    - #### init

          public boolean init(android.content.Context context)

      Specified by:
        `init` in class `UhfBase`

    - #### free

          public boolean free()

      Overrides:
        `free` in class `UhfBase`

    - #### getConnectStatus

          public ConnectionStatus getConnectStatus()

      获取UHF连接状态
      Acquire UHF connection status
      Specified by:
        `getConnectStatus` in interface `IBleDevice`
      Specified by:
        `getConnectStatus` in class `UhfBase`
      Returns:
        UHF连接状态(UHF connection status)

    - #### isInventorying

          public boolean isInventorying()

      uhf 是否正在盘点
      Specified by:
        `isInventorying` in interface `IBleDevice`
      Specified by:
        `isInventorying` in class `UhfBase`
      Returns:

    - #### setInventoryCallback

          public void setInventoryCallback(IUHFInventoryCallback inventoryCallback)

      设置盘点回调接口，接收循环盘点到的标签数据
      Set the inventory callback interface to receive the label data from the cyclic inventory
      备注：需要在开始循环盘点`startInventoryTag()`之前调用此方法。
      Note: This method needs to be called before starting the loop inventory `startInventoryTag()`.
      Specified by:
        `setInventoryCallback` in interface `IBleDevice`
      Parameters:
        `inventoryCallback` - 盘点回调接口(inventory callback interface)

    - #### getAllTagTotalFromFlash

          public int getAllTagTotalFromFlash()

      获取R2、R6 缓存的标签数量
      Acquire tag amounts in buffer of R2 and R6.
      Specified by:
        `getAllTagTotalFromFlash` in interface `IBleDevice`
      Returns:
        返回缓存标签的数量(return tag amounts in buffer.)

    - #### deleteAllTagToFlash

          public boolean deleteAllTagToFlash()

      删除R2、R6缓存的标签
      Delete tag in buffer of R2 and R6
      Specified by:
        `deleteAllTagToFlash` in interface `IBleDevice`
      Returns:
        true:成功(success) false:失败(failure)

    - #### getTagDataFromFlash

          public java.util.List<UHFTAGInfo> getTagDataFromFlash()

      获取R2、R6缓存的标签信息
      Acquire tag information in buffer of R2 and R6
      Specified by:
        `getTagDataFromFlash` in interface `IBleDevice`
      Returns:
        返回缓存的标签列表(Return tag list of buffer)

    - #### getNewTagTotalFromFlash

          public int getNewTagTotalFromFlash()

      Specified by:
        `getNewTagTotalFromFlash` in interface `IBleDevice`